<template>
 <div class="search_bar">
     <img src="https://sm.ms/image/FO95hAIXyZqoHct" alt="" />
     <!-- 搜索歌曲 -->
     <input type="text" placeholder="输入要搜索的音乐" autocomplete="off" v-model="query" @keyup.enter="searchMusic">
 </div>
</template>

<script>

import { request } from '../network/request'

 export default {
   data () {
     return {
        query: '',
        // musicList: []
     }
   },
   methods: {
       searchMusic: function() {
           request({
              //  url: '/search?keywords='+this.query,
               url: 'proxy/search?keywords='+this.query,
               methods: 'GET'
           }).then(res => {
               this.$emit("bindMusicList", res.data.result.songs)
               console.log(res)
           }).catch(res => {
               console.log("ERR ")
           })
        
       }
   },
   components: {

   }
 }
</script>

<style>

 
</style>
